import { defineComponent, ref, reactive, toRefs } from 'vue'
interface ListType {
  title: string,
  render:Function
}
interface HomeProps {title:String,list:Array<ListType> }
interface dataObject {
  list:Array<ListType>,
  obj:ListType,
  title:string
}

export default defineComponent({
  name: 'demo',
  props: {
    list:Array,
    title:[String,Number],
    dataObject:Object
  },
  setup(props) {

    const click:Function = () => {
      alert('helloword')
    }
    let dssssataObject: dataObject = (props.dataObject as dataObject);
    const  title:string = dssssataObject.title;
    const list:Array<ListType> = props.dataObject?.list;
    return () => (
      <div >  
        {
          list.map((x:any,i:Number)=>{
            return<div>
              <li>{ x.title }</li>
              <li>{ x.render(x) }222222222</li>
            </div>
          })
        }
        
        <el-button onClick={click} type="primary"> Click to download PDF {title} </el-button>
      </div>
    )
  }

})
